import request from '@/utils/request'

// 查询采购信息列表
export function listWarePurchase(query) {
  return request({
    url: '/mall/warePurchase/list',
    method: 'get',
    params: query
  })
}
// 查询未分配的采购单
export function unreceive() {
  return request({
    url: '/mall/warePurchase/unreceive',
    method: 'get'
  })
}

// 分配人员
export function updateAssignWarePurchase(data) {
  return request({
    url: '/mall/warePurchase/updateAssignWarePurchase',
    method: 'put',
    data: data
  })
}

// 完成采购
export function finishPurchaseOrder(data) {
  return request({
    url: '/mall/warePurchase/finishPurchaseOrder',
    method: 'post',
    data: data
  })
}

// 领取采购单
export function receivePurchase(data) {
  return request({
    url: '/mall/warePurchase/receivePurchase',
    method: 'put',
    data: data
  })
}


// 查询采购信息详细
export function getWarePurchase(id) {
  return request({
    url: '/mall/warePurchase/' + id,
    method: 'get'
  })
}

// 新增采购信息
export function addWarePurchase(data) {
  return request({
    url: '/mall/warePurchase',
    method: 'post',
    data: data
  })
}

// 修改采购信息
export function updateWarePurchase(data) {
  return request({
    url: '/mall/warePurchase',
    method: 'put',
    data: data
  })
}

// 删除采购信息
export function delWarePurchase(id) {
  return request({
    url: '/mall/warePurchase/' + id,
    method: 'delete'
  })
}

// 导出采购信息
export function exportWarePurchase(query) {
  return request({
    url: '/mall/warePurchase/export',
    method: 'get',
    params: query
  })
}
